package com.foreknow.service.impl;

import com.foreknow.bean.Emp;
import com.foreknow.dao.EmpDao;
import com.foreknow.dao.impl.EmpDaoImpl;
import com.foreknow.service.EmpService;

public class EmpServiceImpl implements EmpService {
    private EmpDao empDao;

    //给属性初始化的
    public void setEmpDao(EmpDao empDao) {
        this.empDao = empDao;
    }

    @Override
    public void save(Emp emp) {
        //开启事务
        //1.
        //2.
        //3.
        //提交事务（回滚事务）
        empDao.add(emp);
    }
}
